package com.wawi.common;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @description 返回前台的json数据
 * @author 龚亮
 * @date 2015-05-18 14:42:28
 */
@SuppressWarnings({"all"})
public class ResultData <M>{

	private String resMsg="请求成功!";         //是否请求成功
	/*
	 * 0   请求成功 
	 * 1   请求失败
	 */
	private String resCode="0";     
    private Long total=0L;
    private List<M> rows=new ArrayList<M>();
	public ResultData(){
	}
	public ResultData(List<M> rows,Long total){
		this();
		this.rows=rows;
		this.total=total;
	} 
	public ResultData(M row){
		this();
		this.rows.add(row);
		this.total=1L;
	} 
	public String getResMsg() {
		return resMsg;
	}
	public void setResMsg(String resMsg) {
		this.resMsg = resMsg;
	}
	public Long getTotal() {
		return total;
	}
	public void setTotal(Long total) {
		this.total = total;
	}
	public List<M> getRows() {
		return rows;
	}
	public void setRows(List<M> rows) {
		this.rows = rows;
		this.total=rows.size()+0L;
	}
	public void setRows(M rows) {
		this.rows.add(rows);
		this.total=1L;
	}
	public String getResCode() {
		return resCode;
	}
	public void setResCode(String resCode) {
		this.resCode = resCode;
	}
}
